﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace TestcraftLibrary.Common
{
    public class BufferedList<T> : IList<T>
    {
        private class ItemIndexPair
        {
            public T Item { get; private set; }
            public int Index { get; private set; }

            public ItemIndexPair(T item, int index)
            {
                this.Item = item;
                this.Index = index;
            }
        }

        private List<T> current;
        private List<int> pendingRemoval;
        private List<ItemIndexPair> pendingAdd;

        public int IndexOf(T item)
        {
            return this.current.IndexOf(item);
        }

        public void Insert(int index, T item)
        {
            this.pendingAdd.Add(new ItemIndexPair(item, index));
        }

        public void RemoveAt(int index)
        {
            this.pendingRemoval.Add(index);
        }

        public T this[int index]
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public void Add(T item)
        {
            throw new NotImplementedException();
        }

        public void Clear()
        {
            throw new NotImplementedException();
        }

        public bool Contains(T item)
        {
            throw new NotImplementedException();
        }

        public void CopyTo(T[] array, int arrayIndex)
        {
            throw new NotImplementedException();
        }

        public int Count
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsReadOnly
        {
            get { throw new NotImplementedException(); }
        }

        public bool Remove(T item)
        {
            throw new NotImplementedException();
        }

        public IEnumerator<T> GetEnumerator()
        {
            throw new NotImplementedException();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            throw new NotImplementedException();
        }
    }
}
